package Management;

public class Satellite {
    private String cosparid;  // id
    private String name;       // 名称
    private boolean status;   // 状态
    private double loc;                // 位置（高度)

    Satellite(String cosparid, String name, double loc) {
        this.cosparid = cosparid;
        this.name = name;
        this.status = true;
        this.loc = loc;
    }

    public String toString() {
        String s1 = "COSPARID="+cosparid+",";
        String s2 = "name="+name+",";
        String s3 = "r="+loc+",";
        String s4 = "activated="+status+",";
        String s = "satellite " + "[" + s1 + s2 + s3 + s4 + "]";
        return s;
    }

    public String get_id() {
        return this.cosparid;
    }

    public String get_name() {
        return this.name;
    }

    public double get_loc() {
        return this.loc;
    }

    public boolean get_status() {
        return this.status;
    }

    public boolean change_id(String id) {
        this.cosparid = id;
        return true;
    }

    public boolean change_name(String n) {
        this.name = n;
        return true;
    }

    public boolean change_status() {
        if(this.status == true) this.status = false;
        else this.status = true;
        return true;
    }

}
